<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>RKNPU DDK: graph.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">RKNPU DDK
   &#160;<span id="projectnumber">1.3.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_063fc4e4818385ae84b46306c1f7aeef.html">rknpu</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">graph.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="graph_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">// Copyright (c) 2020 by Rockchip Electronics Co., Ltd. All Rights Reserved.</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">// You may obtain a copy of the License at</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">//     http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">// See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// limitations under the License.</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &lt;memory&gt;</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="tensor_8h.html">tensor.h</a>&quot;</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="operator_8h.html">operator.h</a>&quot;</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacerk.html">rk</a> {</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="keyword">namespace </span>nn {</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="classrk_1_1nn_1_1_graph.html">   29</a></span>&#160;<span class="keyword">class </span><a class="code" href="classrk_1_1nn_1_1_graph.html">Graph</a></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;{</div><div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="classrk_1_1nn_1_1_graph.html#ac056aa11272ec5d039eb9be784d40877">   31</a></span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classrk_1_1nn_1_1_exection.html">Exection</a>;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    <span class="keywordtype">void</span> *pri_data;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    <a class="code" href="classrk_1_1nn_1_1_graph.html#afc5ef9d72cc2c509814200791eaef62c">Graph</a>();</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <a class="code" href="classrk_1_1nn_1_1_graph.html#af5a604e5e9e4d68dbc10b312e59f678f">~Graph</a>();</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    std::shared_ptr&lt;Operator&gt; <a class="code" href="classrk_1_1nn_1_1_graph.html#ab750822d7f142a9530d105d6b63ed9e6">AddOperator</a>(<a class="code" href="namespacerk_1_1nn.html#a6a02b2d1d62293b20242e3dcfbdd0117">OperatorType</a> type, std::vector&lt;std::shared_ptr&lt;Tensor&gt;&gt;inputs, std::vector&lt;std::shared_ptr&lt;Tensor&gt;&gt;outputs, <span class="keywordtype">void</span> *attrs, std::string name = <span class="stringliteral">&quot;&quot;</span>);</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    std::shared_ptr&lt;Tensor&gt; <a class="code" href="classrk_1_1nn_1_1_graph.html#a47037f219da7fa7b34b24451ee917898">CreateTensor</a>(std::shared_ptr&lt;TensorAttr&gt; attr, <span class="keywordtype">void</span> *data);</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classrk_1_1nn_1_1_graph.html#aacd7044be98d5a9eecbef6a844b2c829">SetInputsOutputs</a>(std::vector&lt;std::shared_ptr&lt;Tensor&gt;&gt; input_tensors, std::vector&lt;std::shared_ptr&lt;Tensor&gt;&gt; output_tensors);</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    std::vector&lt;std::shared_ptr&lt;Tensor&gt;&gt; <a class="code" href="classrk_1_1nn_1_1_graph.html#a99030fda5c18514c1c07220e6b726fb5">GetInputs</a>();</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    std::vector&lt;std::shared_ptr&lt;Tensor&gt;&gt; <a class="code" href="classrk_1_1nn_1_1_graph.html#acf0264ec0bb37c6eda9b584bd9820177">GetOutputs</a>();</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    </div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    std::vector&lt;std::shared_ptr&lt;TensorAttr&gt;&gt; <a class="code" href="classrk_1_1nn_1_1_graph.html#a0944cb9866a1c6409410e0fb75fe4b62">GetInputTensorsAttr</a>();</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    std::vector&lt;std::shared_ptr&lt;TensorAttr&gt;&gt; <a class="code" href="classrk_1_1nn_1_1_graph.html#a9ee83c28fa54bc3c7222da91a4b90a2e">GetOutputTensorsAttr</a>();</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    </div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classrk_1_1nn_1_1_graph.html#a1cbb0a36b1567595284195ce8c4c2894">EnableCreateCache</a>(std::string cache_path);</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classrk_1_1nn_1_1_graph.html#a410a3c082f3d0858b398c6cc9f8e6a0b">LoadCache</a>(std::string cache_path);</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classrk_1_1nn_1_1_graph.html#a410a3c082f3d0858b398c6cc9f8e6a0b">LoadCache</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* cache_buf,<span class="keywordtype">size_t</span> size);</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;};</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;}</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;}</div><div class="ttc" id="classrk_1_1nn_1_1_graph_html_ab750822d7f142a9530d105d6b63ed9e6"><div class="ttname"><a href="classrk_1_1nn_1_1_graph.html#ab750822d7f142a9530d105d6b63ed9e6">rk::nn::Graph::AddOperator</a></div><div class="ttdeci">std::shared_ptr&lt; Operator &gt; AddOperator(OperatorType type, std::vector&lt; std::shared_ptr&lt; Tensor &gt;&gt;inputs, std::vector&lt; std::shared_ptr&lt; Tensor &gt;&gt;outputs, void *attrs, std::string name=&quot;&quot;)</div></div>
<div class="ttc" id="classrk_1_1nn_1_1_graph_html_aacd7044be98d5a9eecbef6a844b2c829"><div class="ttname"><a href="classrk_1_1nn_1_1_graph.html#aacd7044be98d5a9eecbef6a844b2c829">rk::nn::Graph::SetInputsOutputs</a></div><div class="ttdeci">int SetInputsOutputs(std::vector&lt; std::shared_ptr&lt; Tensor &gt;&gt; input_tensors, std::vector&lt; std::shared_ptr&lt; Tensor &gt;&gt; output_tensors)</div></div>
<div class="ttc" id="classrk_1_1nn_1_1_graph_html_a1cbb0a36b1567595284195ce8c4c2894"><div class="ttname"><a href="classrk_1_1nn_1_1_graph.html#a1cbb0a36b1567595284195ce8c4c2894">rk::nn::Graph::EnableCreateCache</a></div><div class="ttdeci">int EnableCreateCache(std::string cache_path)</div></div>
<div class="ttc" id="classrk_1_1nn_1_1_graph_html_a47037f219da7fa7b34b24451ee917898"><div class="ttname"><a href="classrk_1_1nn_1_1_graph.html#a47037f219da7fa7b34b24451ee917898">rk::nn::Graph::CreateTensor</a></div><div class="ttdeci">std::shared_ptr&lt; Tensor &gt; CreateTensor(std::shared_ptr&lt; TensorAttr &gt; attr, void *data)</div></div>
<div class="ttc" id="classrk_1_1nn_1_1_graph_html_afc5ef9d72cc2c509814200791eaef62c"><div class="ttname"><a href="classrk_1_1nn_1_1_graph.html#afc5ef9d72cc2c509814200791eaef62c">rk::nn::Graph::Graph</a></div><div class="ttdeci">Graph()</div></div>
<div class="ttc" id="classrk_1_1nn_1_1_graph_html"><div class="ttname"><a href="classrk_1_1nn_1_1_graph.html">rk::nn::Graph</a></div><div class="ttdef"><b>Definition:</b> <a href="graph_8h_source.html#l00029">graph.h:29</a></div></div>
<div class="ttc" id="tensor_8h_html"><div class="ttname"><a href="tensor_8h.html">tensor.h</a></div></div>
<div class="ttc" id="classrk_1_1nn_1_1_graph_html_af5a604e5e9e4d68dbc10b312e59f678f"><div class="ttname"><a href="classrk_1_1nn_1_1_graph.html#af5a604e5e9e4d68dbc10b312e59f678f">rk::nn::Graph::~Graph</a></div><div class="ttdeci">~Graph()</div></div>
<div class="ttc" id="operator_8h_html"><div class="ttname"><a href="operator_8h.html">operator.h</a></div></div>
<div class="ttc" id="namespacerk_1_1nn_html_a6a02b2d1d62293b20242e3dcfbdd0117"><div class="ttname"><a href="namespacerk_1_1nn.html#a6a02b2d1d62293b20242e3dcfbdd0117">rk::nn::OperatorType</a></div><div class="ttdeci">OperatorType</div><div class="ttdef"><b>Definition:</b> <a href="operator_8h_source.html#l00041">operator.h:41</a></div></div>
<div class="ttc" id="classrk_1_1nn_1_1_graph_html_acf0264ec0bb37c6eda9b584bd9820177"><div class="ttname"><a href="classrk_1_1nn_1_1_graph.html#acf0264ec0bb37c6eda9b584bd9820177">rk::nn::Graph::GetOutputs</a></div><div class="ttdeci">std::vector&lt; std::shared_ptr&lt; Tensor &gt; &gt; GetOutputs()</div></div>
<div class="ttc" id="classrk_1_1nn_1_1_exection_html"><div class="ttname"><a href="classrk_1_1nn_1_1_exection.html">rk::nn::Exection</a></div><div class="ttdef"><b>Definition:</b> <a href="exection_8h_source.html#l00090">exection.h:90</a></div></div>
<div class="ttc" id="classrk_1_1nn_1_1_graph_html_a9ee83c28fa54bc3c7222da91a4b90a2e"><div class="ttname"><a href="classrk_1_1nn_1_1_graph.html#a9ee83c28fa54bc3c7222da91a4b90a2e">rk::nn::Graph::GetOutputTensorsAttr</a></div><div class="ttdeci">std::vector&lt; std::shared_ptr&lt; TensorAttr &gt; &gt; GetOutputTensorsAttr()</div></div>
<div class="ttc" id="classrk_1_1nn_1_1_graph_html_a99030fda5c18514c1c07220e6b726fb5"><div class="ttname"><a href="classrk_1_1nn_1_1_graph.html#a99030fda5c18514c1c07220e6b726fb5">rk::nn::Graph::GetInputs</a></div><div class="ttdeci">std::vector&lt; std::shared_ptr&lt; Tensor &gt; &gt; GetInputs()</div></div>
<div class="ttc" id="classrk_1_1nn_1_1_graph_html_a410a3c082f3d0858b398c6cc9f8e6a0b"><div class="ttname"><a href="classrk_1_1nn_1_1_graph.html#a410a3c082f3d0858b398c6cc9f8e6a0b">rk::nn::Graph::LoadCache</a></div><div class="ttdeci">int LoadCache(std::string cache_path)</div></div>
<div class="ttc" id="namespacerk_html"><div class="ttname"><a href="namespacerk.html">rk</a></div><div class="ttdef"><b>Definition:</b> <a href="exection_8h_source.html#l00017">exection.h:17</a></div></div>
<div class="ttc" id="classrk_1_1nn_1_1_graph_html_a0944cb9866a1c6409410e0fb75fe4b62"><div class="ttname"><a href="classrk_1_1nn_1_1_graph.html#a0944cb9866a1c6409410e0fb75fe4b62">rk::nn::Graph::GetInputTensorsAttr</a></div><div class="ttdeci">std::vector&lt; std::shared_ptr&lt; TensorAttr &gt; &gt; GetInputTensorsAttr()</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
